package com.tarena.utils;

import com.tarena.pojo.User;
import com.tarena.view.ChatMainWindow;

import java.util.HashMap;

public class ManageUserWindowList {
    private static HashMap<User, ChatMainWindow> uws = new HashMap<>();
    //添加用户和它的window到uws中
    public static void addUserWindowToMap(User user,ChatMainWindow cmw){
        uws.put(user,cmw);
    }
    //移除用户和它的window出uws中
    public static void removeUserWindowFromMap(User user){
        uws.remove(user);
    }
    /*通过指定的user对象找到对应的window对象*/

    public static ChatMainWindow findUserWindowFromMap(User user){
        return uws.get(user);
    }
}
